<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<style>

#cdiTable thead tr td{
	font-size: 16px;
	border-color: blue;
	background-color: yellow;
	padding:4px;
	color: blue;	
}

#sumTr td{
	color: black;	
}
</style>

<c:if test="${showReport != null }">

<div >

<h2>客訴案件數管報及列表統計</h2>

<p>
搜尋條件: <br>
期間  = ${startDate } ~ ${endDate }<br>
案件類別  = ${typeMap[caseType]}<br>
廠區 = ${madeinMap[madeIn]}
</p>

 
<table border="1" id="cdiTable" class="tablesorter"  style="width: 1200px;">

	<thead>
	<tr>
		<td colspan="2" >逾期否\階段</td>
		<td>品情登錄</td>	
		<td>品保指派</td>	
		<td>品管指派</td>	
		<td>初步調查</td>	
		<td>初步回覆</td>	
		<td>客訴判定</td>	
		<td>真因分析</td>
		<td>永久對策</td>	
		<td>客戶確認</td>	
		<td>處級審核</td>	
		<td>追蹤確認</td>	
		<td>結案</td>	
		<td>合計</td>
	</tr>
</thead>
	
	<tbody>
	
	<c:if test="${empty sums}">
		<tr>
     		<td colspan="14" >查無客訴資料</td>
     	</tr>
	</c:if>
	
	<tr>
	<td rowspan="3">${madeinMap[madeIn]}</td>
	<td>執行中</td>
	<c:forEach var="s" items="${sums[0]}" varStatus="status">
		<c:if test="${status.index < 11}">
			<td>			
				<a href="<c:url value="/report08/0804-1/find.do?startDate=${startDate}&endDate=${endDate}&caseType=${caseType}&madeIn=${madeIn}&step=${status.index+1 }" />">${s}</a>
			</td>
		</c:if>
		<c:if test="${status.index == 11}">
			<td>
				<a href="<c:url value="/report08/0804-4/find.do?startDate=${startDate}&endDate=${endDate}&caseType=${caseType}&isFinish=true" />">${s}</a>
			</td>
		</c:if>
		<c:if test="${status.index == 12}">
			<td>
				<a href="<c:url value="/report08/0804-5/find.do?startDate=${startDate}&endDate=${endDate}&caseType=${caseType}&madeIn=${madeIn}" />">${s}</a>
			</td>
		</c:if>
		
	</c:forEach>
	</tr>
	
	<tr>
	<td>逾期</td>
	<c:forEach var="s" items="${sums[0]}" >
		<td>---</td>
	</c:forEach>
	</tr>
	
	
	
	<tr>
	<td>合計</td>
	<c:forEach var="s" items="${sums[0]}" varStatus="status">
		<c:if test="${status.index < 11}">
			<td>			
				<a href="<c:url value="/report08/0804-1/find.do?startDate=${startDate}&endDate=${endDate}&caseType=${caseType}&madeIn=${madeIn}&step=${status.index+1 }" />">${s}</a>
			</td>
		</c:if>
		<c:if test="${status.index == 11}">
			<td>
				<a href="<c:url value="/report08/0804-4/find.do?startDate=${startDate}&endDate=${endDate}&caseType=${caseType}&isFinish=true" />">${s}</a>
			</td>
		</c:if>
		<c:if test="${status.index == 12}">
			<td>
				<a href="<c:url value="/report08/0804-5/find.do?startDate=${startDate}&endDate=${endDate}&caseType=${caseType}&madeIn=${madeIn}" />">${s}</a>
			</td>
		</c:if>
	</c:forEach>
	</tr>	
	
	</tbody>
	
	
	
</table>

</div>

</c:if>

<script>
$(function() {
	$("#cdiTable").tablesorter({
		widgets: ['zebra']
		}); 
})

</script>
